<script setup lang="ts">
// import "../../assets/styles/css/index.css"
import { onMounted, reactive, ref } from 'vue'
import World from '../../components/ThreeJS/world/Word'

onMounted(() => {
  const dom: any = document.querySelector('#earth-canvas')
  new World({ dom })
})
</script>

<template>
  <div class="bg">
    <div id="loading" class="loader-radar" />
    <div id="html2canvas" class="css3d-wapper" />
    <div id="earth-canvas" />
  </div>
</template>

<style lang="scss" scoped>
#earth-canvas {
  height: 100%;
  width: 100%;
  background: #010826 url('/images/img/bg.png') no-repeat center bottom;
  background-size: contain;
}

#html2canvas {
  position: absolute;
  z-index: -1;
  left: 0;
  top: 0;
  background: rgba(0, 0, 0, 0);
}

#loading {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  /* width: 50px;
  height: 50px; */
  z-index: 999;
  /* background: #010826; */
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  color: #409eff;
  font-size: 15px;
  letter-spacing: 2px;
  overflow: hidden;
  margin: auto;
}

@keyframes zoomOut {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0;
    transform: scale3d(1.3, 1.3, 1.3);
  }

  to {
    opacity: 0;
  }
}

#loading.out {
  animation: zoomOut 0.5s linear forwards;
  pointer-events: none;
}

#loading.out .sk-chase-dot,
#loading.out .sk-chase {
  animation: null;
}

[class*='loader'] {
  position: relative;
  top: 40%;
  display: inline-block;
  margin: 0 auto;
  cursor: wait;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.loader-radar {
  width: 4em;
  height: 4em;
  top: 33%;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid #0e5f76;
  z-index: 1;
  background-color: rgba(8, 61, 86, 0.2);
  background-image: repeating-radial-gradient(
    transparent 0,
    transparent 0.39em,
    rgba(8, 61, 86, 0.5) 0.45em,
    rgba(8, 61, 86, 0.5) 0.5em
  );
}

#toggle:checked ~ #sect .loader-radar {
  background-image: repeating-radial-gradient(
      transparent 0,
      transparent 0.39em,
      rgba(8, 61, 86, 0.5) 0.45em,
      rgba(8, 61, 86, 0.5) 0.5em
    ),
    repeating-radial-gradient(
      transparent 0,
      transparent 0.39em,
      rgba(0, 0, 0, 0.25) 0.45em,
      rgba(0, 0, 0, 0.25) 0.5em
    );
  background-position: 0px 0px, 1px 1px;
  box-shadow: 0.25em 0.25em 0.25em rgba(0, 0, 0, 0.25),
    inset 0.25em 0.25em 0.25em rgba(0, 0, 0, 0.25);
}

.loader-radar:before,
.loader-radar:after {
  content: '';
  position: absolute;
  display: block;
}

.loader-radar:before {
  z-index: 0;
  width: 2.5em;
  height: 2em;
  top: 50%;
  left: 50%;
  transform-origin: left top;
  border-left: 0.1em solid #19a6cf;
  background-image: linear-gradient(
    to right,
    rgba(8, 61, 86, 0.75) 0%,
    transparent 85%
  );
  -webkit-animation: radar 2s infinite linear;
  animation: radar 2s infinite linear;
}

.loader-radar:after {
  left: 62%;
  top: 34%;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background-color: currentColor;
  -webkit-animation: radarDotGlow 2s infinite linear,
    radarDotMove 15s infinite cubic-bezier(0.5, -0.35, 0.5, 1.35);
  animation: radarDotGlow 2s infinite linear,
    radarDotMove 15s infinite cubic-bezier(0.5, -0.35, 0.5, 1.35);
}

@-webkit-keyframes radar {
  to {
    transform: rotate(359deg);
  }
}

@keyframes radar {
  to {
    transform: rotate(359deg);
  }
}

@-webkit-keyframes radarDotGlow {
  0%,
  59.9%,
  87%,
  100% {
    color: rgba(25, 166, 207, 0.33);
    box-shadow: 0 0 0.1em 0.05em currentColor;
  }

  62% {
    color: #19a6cf;
    box-shadow: 0 0 0.1em 0.1em currentColor;
  }
}

@keyframes radarDotGlow {
  0%,
  59.9%,
  87%,
  100% {
    color: rgba(25, 166, 207, 0.33);
    box-shadow: 0 0 0.1em 0.05em currentColor;
  }

  62% {
    color: #19a6cf;
    box-shadow: 0 0 0.1em 0.1em currentColor;
  }
}

@-webkit-keyframes radarDotMove {
  0% {
    top: 0%;
    left: 85%;
  }

  40% {
    top: 30%;
    left: 70%;
  }

  100% {
    top: 50%;
    left: 50%;
  }
}

@keyframes radarDotMove {
  0% {
    top: 0%;
    left: 85%;
  }

  40% {
    top: 30%;
    left: 70%;
  }

  100% {
    top: 50%;
    left: 50%;
  }
}
</style>

<style lang="css">
.css3d-wapper {
  pointer-events: none;
  color: #fff;
}

.css3d-wapper .fire-div {
  /* font-size: 20px; */
  /* font-weight: 600; */
  border-top: 3px solid #0cd1eb;
  padding: 6px 8px;
  min-width: 50px;
  background: rgba(40, 108, 181, 0.5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: nowrap;
}

.data-content {
  position: absolute;
  width: 370px;
  height: 30px;
  background: linear-gradient(-14deg, #73afae, #2e58df);
  opacity: 0.72;
  top: 80px;
  left: 10px;
}

.data-content .data-text {
  height: 30px;
  line-height: 30px;
  color: #5df5f3;
  font-size: 16px;
  padding-left: 10px;
}
</style>
